<template>
  <el-col :span="24" class="header">
    <el-input
    class="search"
    placeholder="在已发表的日记中搜索..."
    v-model="keyWord"></el-input>
    <el-button @click="searchDiary">搜索</el-button>
  </el-col>
</template>

<script>
  export default {
    methods:{
      searchDiary(){
        var _this = this;
        this.$router.push({
        path:"/search",
        query:{
        	searchContent:encodeURI(_this.$data.keyWord)
        	}
        })
      }
    },
    data(){
      return{
        keyWord:'',   //搜索框输入内容
      }
    }
  }
</script>

<style>
  .header {
    background-color: #335585;
    border-radius: 0px;
    height: 60px;
  }
</style>
